<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>8-通过call方法实现继承关系</title>
	</head>
	<body>
		<script type="text/javascript">
			/**
			   ES6里面继承
			   class Father{
				  //父类(超类) 
			   }
			   class Son extends Father{
				   
			   }
			*/
		    /**
			 * ES5 通过构造函数模拟类定义
			 */
			function Father(username,age){
				this.username = username;
				this.age = age;
			}
			//子构造
			function Son(username,age,score){
				//我们想把父构造的属性设置过来
				Father.call(this,username,age);
				this.score = score;
			}
			
			var s = new Son('百度',22,100);
			console.log(s);
		</script>
	</body>
</html>